When i run rails commands on the terminal like creating a model, this is the error I get:
WARNING: /Users/my_mac_username/.rvm/rubies/ruby-2.5.3/bin/ruby is loading libcrypto in an unsafe way
[1] 5396 abort bin/rails g model ModelName attribute_1:string attribute_2:integer
My mac is running big sur,
I ended up solving the same issue using information from this thread: https://giters.com/se3000/ruby-eth/issues/47
The solution which worked out of the box for me, on an M1 Mac, was to use the following:
sudo ln -s $(brew --prefix openssl)/lib/libcrypto.dylib /usr/local/lib/
sudo ln -s $(brew --prefix openssl)/lib/libssl.dylib /usr/local/lib
This is definitely a dylib issue, as @tbraden pointed out.
This is just a warning not a fatal error. On mac you can open the Console program (spotlight search Console) and look for the ruby crash log.
For me it is error on invalid dylib load, which can be solved by creating the symlink following this thread https://developer.apple.com/forums/thread/119429.
this one will work if you have latest version of libssl
However if you have 1.1 version, you need to run the following
sudo ln -s $(brew --prefix openssl@1.1)/lib/libcrypto.dylib /usr/local/lib/
sudo ln -s $(brew --prefix openssl@1.1)/lib/libssl.dylib /usr/local/lib
Also before running any command you can verify to which version it points on current moment
ls -la /usr/local/lib/libcrypto.dylib
lrwxr-xr-x 1 root admin 46 Mar 3 14:27 /usr/local/lib/libcrypto.dylib -> /usr/local/opt/openssl@1.1/lib/libcrypto.dylib
ls -la /usr/local/lib/libssl.dylib
lrwxr-xr-x 1 root admin 43 Mar 3 14:27 /usr/local/lib/libssl.dylib -> /usr/local/opt/openssl@1.1/lib/libssl.dylib